package com.js.lottery.domin.support.ids.policy;

import com.js.lottery.domin.support.ids.IIdGenerator;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.stereotype.Component;

/**
 * @description:
 * 随机数ID，自定义位数，适用与创建量小的Id，这样重复率就少。
 * 工具类生成 org.apache.commons.lang3.RandomStringUtils
 * @author:Pine Jiang
 * @Date:2023/11/23
 **/

@Component
public class RandomNumeric implements IIdGenerator {
    @Override
    public long nextId() {
        return Long.parseLong(RandomStringUtils.randomNumeric(11));
    }
}
